package com.haifeng.wdsh.business.sys.controller;

import com.haifeng.wdsh.business.sys.service.UserService;
import com.haifeng.wdsh.common.base.util.Rest;
import com.haifeng.wdsh.common.datasource.entity.User;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户管理
 */
@RestController
@RequestMapping("/user")
@AllArgsConstructor
public class UserController extends BaseController {

    private final UserService userService;

    @GetMapping("/getUserByUsername")
    Rest<User> getUserByUsername(@RequestParam("username") String username) {
        return Rest.success(userService.findByUserName(username));
    }
}
